﻿using KAKA.Domain;
using Morus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KAKA.Repository
{
    public abstract class DecoratedSettingRepository : ISettingRepository
    {
        private ISettingRepository InnerRepository { get; set; }

        public DecoratedSettingRepository(ISettingRepository innerRepository)
        {
            Check.Argument.IsNotNull(innerRepository, "innerRepository");

            InnerRepository = innerRepository;
        }

        public virtual Setting GetByName(string name)
        {
            return InnerRepository.GetByName(name);
        }

        public void Add(Setting aggregateRoot)
        {
            InnerRepository.Add(aggregateRoot);
        }

        public void Commit()
        {
            InnerRepository.Commit();
        }

        public void Dispose()
        {
            InnerRepository.Dispose();
        }
    }
}
